package com.cebbank.yyi.springbootapp.jingtang.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public enum ApprovalTypeEnum {

    REFUSE("1", "REFUSE"),

    AGREE("0", "AGREE"),

    TRANSFER("4", "TRANSFER");

    private final String code;

    private final String status;

    public static String getStatusByCode(String code) {
        for (ApprovalTypeEnum e : ApprovalTypeEnum.values()) {
            if (e.code.equals(code)) {
                return e.getStatus();
            }
        }
        return null;
        //throw new Exception("DocBaseTypeEnum：映射失败，当前TYPE为：" + type);
    }

    public static void main(String[] args) {
        String byStatus = getStatusByCode("1");
        System.err.println(byStatus);
    }

}
